﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Net.ColorMath
{
    public class CW
    {
        public static float GetModule(Color color)
        {
            return (float)Math.Sqrt((double)(color.ScA * color.ScA + color.ScB * color.ScB + color.ScG * color.ScG + color.ScR * color.ScR));
        }

        // Get color from double value
        public static Color GetColor(double m)
        {
            byte v = (byte)(m * 500);
            return new Color() { R = v, G = v, B = v, A = 255 }; 
        }
    }
}
